﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 简单工厂模式
{
    internal class OperationDiv:Operation
    {
        public override double GetResult()
        {
            double result = 0;
            if (this.NumberB!=0)
            {
                result = this.NumberA / this.NumberB;
            }
            else
            {
                throw new Exception("除数不能为0");
            }

            return result;
        }
    }
}
